package com.example.cwproject.mapper;

import com.example.cwproject.entity.Email;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface EmailMapper {

    @Insert("insert into `email` (email, verify_code) values (#{email},#{verifyCode})")
    void insert(Email email);

    @Select("select verify_code from `email` where email = #{email} ")
    String selectByEmail(String email);

    @Select("select * from `email` where email = #{email} ")
    Email selectAllByEmail(String email);

    @Update("update `email` set verify_code = #{verify} where email = #{email}")
    void updateVerifyCode(String email,String verify);
}
